<script setup>
	import {
		computed,
		ref
	} from "vue";
	const obj = ref({
		name: "",
		age: "",
		gender: "",
		like: ""
	})
	const state = computed(() => {
		return !Object.values(obj.value).some(item => item)
	})
	function onSubmit() {
		console.log("提交");
	}
</script>
<template>
	<view class="layout">
		<input type="text" v-model="obj.name" placeholder="请输入姓名">
		<input type="text" v-model="obj.age" placeholder="请输入年龄">
		<input type="text" v-model="obj.gender" placeholder="请输入性别">
		<input type="text" v-model="obj.like" placeholder="请输入爱好">
		<button type="primary" :disabled="state" @click="onSubmit">提交</button>
	</view>
</template>
<style lang="scss" scoped>
	.layout {
		padding: 30rpx;

		input {
			border: 1px solid #e4e4e4;
			height: 80rpx;
			margin-bottom: 20rpx;
			padding: 0 20rpx;
		}
	}
</style>